<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">
    var json = {a:1,b:2,c:3};
    var arr = [1,2,3];

    for(var i in json){
        alert("第"+i+"个元素是："+json[i]);
    }
    for(var i=0;i<arr.length;i++){
        alert("第"+i+"个元素是："+arr[i]);
    }
</script>
</body>
</html>